<template>
	<view class="myCommunity">
		<view class="container" style="height: 1px;"></view>
		<view class="container">
			<!-- 没有内容 -->
			<view class="w100" v-if="appealList.length == 0">
				<view class="w100 flex-xy"><image src="../../static/noMsg.png" mode="widthFix" style="width: 60%;" class="mt50"></image></view>
			</view>

			<view class="w100" v-else>
				<view class="container bgF pt30 pb30 pl20 pr20" style="margin-bottom: 1px;" v-for="(item, i) in appealList" v-bind:key="i">
					<view class="w100 flex-spc-x">
						<view class="tel">
							<text>账号：{{ item.phone }}</text>
							<!-- <text class="co999 fs25 ml10">未实名</text> -->
						</view>
						<view class="tar">团队人数：{{ item.number }}</view>
					</view>
				</view>
				<view class="container  mt20 mb20" style="background: #f3f3f3;"><u-divider color="#CCC" bg-color="#f3f3f3">~到底了,宝贝~</u-divider></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			appealList: [], //申诉列表
			pageSize: 20, //每页数量
			pageNum: 1 //页码
		};
	},
	methods: {
		// 用户社区GET/mobileUser/phone/getMyCommunity/{userId}
		getAppealList() {
			var getObj = { url: `/mobileUser/phone/getMyCommunity/${uni.getStorageSync('y-userId')}`, data: { pageNum: this.pageNum, pageSize: this.pageSize } };
			this.getRequest(getObj)
				.then(res => {
					// console.log('res用户社区 ', res);
					if (res.data.code == 200) {
						if (res.data.rows.length > 0) {
							res.data.rows.forEach((items, i) => {
								items.phone = items.phone.substring(0, 3) + '*****' + items.phone.substring(8, 11);
							});
						}
						this.appealList = [...this.appealList, ...res.data.rows];
					}
				})
				.catch(err => {
					// console.log('err用户社区 ', err);
				});
		}
	},
	onShow() {
		this.pageNum = 1; //页码
		this.appealList = [];
		this.getAppealList(); //查询订单列表
	},
	// 触底事件
	onReachBottom() {
		this.pageNum += 1;
		this.getAppealList();
	}
};
</script>

<style lang="less" scoped></style>
